#pragma once

#include <string>
#include "IGUIElement.h"
#include "HashedString.h"
#include "Matrix.h"
#include "Functor.h"

class GUIWindow : public IGUIElement
{
public:
	GUIWindow();
	~GUIWindow();

	enum
	{
		NONE = 0,
		LEFT = 0x0001,
		RIGHT = 0x0010,
		LEFTRIGHT = 0x0011,
		TOP = 0x0100,
		BOTTOM = 0x1000,
		TOPBOTTOM = 0x1100
	};

	void Dock( unsigned int docking );
	void Paint();
	void Location( Maths::Point<unsigned int>& location );
	void Title( std::string& title );
	std::string Title() const;
	void Font( std::string& font );
	void Font( HashedString& font );
	HashedString Font() const;
	void FontColor( unsigned int color );
	unsigned int FontColor() const;
	void Background( std::string& font );
	void Background( HashedString& font );
	HashedString Background() const;
	void AddChild( Pointer<IGUIElement> element );
	void ClearChildren();
	void ParentLocation( Maths::Point<unsigned int>& location );
	bool ReceiveEvent( IEvent& event );
	void EnterFunction( Pointer<Functor>& function );
	bool OnResizeEvent( IEvent& event );
private:
	static std::vector<GUIWindow*> Windows;

	IGUIElement::Vector_t m_children;
	HashedString m_background;
	HashedString m_font;
	unsigned int m_fontColor;
	std::string m_title;
	Pointer<Functor> m_enterFunction;
	bool m_hasFocus;
	unsigned int m_docking;
};